﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="recepi02.aspx.cs" Inherits="ASPNETandJQUERY.chapter01.recepi02" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript" src="scripts/jquery-1.7.1.js">
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('input:text:first').focus();

            $('input:text').bind("keydown", function (e) {
                if (e.which == 13) {
                    e.preventDefault();
                    var nextIndex = $('input:text').index(this) + 1;
                    $('input:text')[nextIndex].focus();
                }
            });

            $('#btnReset').click(function (e) {
                //e.preventDefault();
                $('form')[0].reset();
                $('input:text:first').focus();
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        <fieldset style="width: 400px; height: 200px">
            <table cellspacing="3" cellpadding="3" border="0">
                <tr>
                    <td>
                        <asp:Label ID="lblName" runat="server" Text="Name"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblContact" runat="server" Text="Contact number"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtContact" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
                        <asp:Button ID="btnReset" runat="server" Text="Reset" />
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
    </form>
</body>
</html>
